<?php
session_start();
if (!isset($_SESSION['love'])) {
  header('Location: ./login.php');
}
?>
<div class="panel-body">
    <input type="text" class="form-control" id="user" placeholder="管理员账号" value="<?=$data['user']?>"><br>
    <input type="text" class="form-control" id="pass" placeholder="管理员密码(不改则留空)">
    <label for="name">网站标题</label>
    <input type="text" class="form-control" id="title" placeholder="网站标题" value="<?=$data['title']?>">
    <div class="form-group">
      <label for="name">自定义SEO</label>
      <textarea class="form-control" rows="3" id="seo"><?=$data['seo']?></textarea>
    </div>
    <div class="form-group">
      <label for="name">自定义底部信息(可HTML)</label>
      <textarea class="form-control" rows="3" id="foot"><?=$data['foot']?></textarea>
    </div>
    <center><button type="button" id="ok" class="btn btn-primary" id="ok">保存</button>
</div>
<script>
$("#set").attr("class","active");
$("#ok").click(function(){
    $.post("../api.php?s=set",
    {
        user: $("#user").val(),
        pwd: $("#pass").val(),
        title: $("#title").val(),
        seo: $("#seo").val(),
        foot: $("#foot").val()
    },
    function(data,status){
        var json = JSON.parse(data);
          layer.alert(json['msg']);
    });
});
</script>
</div>